<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Embedded Class Source</title>
</head>
<body>
  <pre class="brush: java">
// Employee.java Source //    
// package declaration and imports removed for brevity
@Entity
public class Employee {
	
	private int id;
	private String name;
	
	private Address address;
	
	@Id @GeneratedValue
	public int getId() {
		return id;
	}
	
	private void setId(int id) {
		this.id = id;
	}
	
	@Column(length = 30, nullable = false)
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	@Embedded
	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}	
}

// Address.java Source //
// package declaration and imports removed for brevity
@Embeddable
public class Address {
	private String street;
	private String city;
	private String state;
	private String zipCode;
	
	@Column(nullable = false, length = 30)
	public String getStreet() {
		return street;
	}
	
	public void setStreet(String street) {
		this.street = street;
	}
	
	@Column(nullable = false, length = 30)
	public String getCity() {
		return city;
	}
	
	public void setCity(String city) {
		this.city = city;
	}
	
	@Column(nullable = false, length = 30)
	public String getState() {
		return state;
	}
	
	public void setState(String state) {
		this.state = state;
	}
	
	@Column(name= "zipcode", nullable = false, length = 10)
	public String getZipCode() {
		return zipCode;
	}
	
	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}
}
  </pre>
</body>
</html>
